package com.project.Util;

import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;

/**
 * @author lyl
 * description:
 */
public class LocalDateChange implements Converter<String, LocalDate> {
    @Override
    public LocalDate convert(String s) {
        if (s != null && s.matches("\\d{4}-\\d{2}-\\d{2}")) {
            return LocalDate.parse(s);
        }
        return null;
    }
}
